package rollinglog_demo

type Option func(logger *RollingLogger)

func WithFilename(fileName string) Option {
	return func(logger *RollingLogger) {
		logger.rollingOutput.Filename = fileName
	}
}

func WithMaxSize(maxSize int) Option {
	return func(logger *RollingLogger) {
		logger.rollingOutput.MaxSize = maxSize
	}
}

func WithMaxAge(maxAge int) Option {
	return func(logger *RollingLogger) {
		logger.rollingOutput.MaxAge = maxAge
	}
}

func WithMaxBackups(maxBackups int) Option {
	return func(logger *RollingLogger) {
		logger.rollingOutput.MaxBackups = maxBackups
	}
}

func WithCompress(compress bool) Option {
	return func(logger *RollingLogger) {
		logger.rollingOutput.Compress = compress
	}
}

func WithLocalTime(localTime bool) Option {
	return func(logger *RollingLogger) {
		logger.rollingOutput.LocalTime = localTime
	}
}
